/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.member.service.AddessService
   Module Description   :

   Date Created      : 2009/12/23
   Original Author   : feeling.wang
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.member.service;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

import com.yaodian100.core.common.dao.impl.CommonCriteria;
import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.service.DomainService;
import com.yaodian100.ec.member.entity.City;
import com.yaodian100.ec.member.entity.District;
import com.yaodian100.ec.member.entity.Province;
import com.yaodian100.ec.tmall.entity.AddrMapping;

/**
 * @author feeling.wang
 * 
 */

public interface AddessService extends DomainService<Province> {
	public void deleteCity(City city) throws CoreException;

	public void deleteDistrict(District district) throws CoreException;

	/**
	 * 产生地址js选单
	 * 
	 * @throws CoreException
	 * @throws Exception
	 */
	public void generateAddress() throws CoreException, Exception;

	/**
	 * 产生地址js选单ForMidend
	 * 
	 * @throws CoreException
	 * @throws Exception
	 */
	public void generateAddressForMidend() throws CoreException, Exception;

	/**
	 * 产生cod地址js选单
	 * 
	 * @throws CoreException
	 * @throws Exception
	 */
	public void generateAddressForCod() throws CoreException, Exception;

	/**
	 * 产生服務區域js选单
	 * 
	 * @throws CoreException
	 * @throws Exception
	 */
	public void generateAddressForServiceSupport() throws CoreException, Exception;

	/**
	 * 查询全部的省份
	 * 
	 * @return
	 * @throws CoreException
	 */
	public List<Province> getAllProvinceList() throws CoreException;

	public List<Province> getProvinceListByShipExpenseRank(String shipExpenseRank) throws CoreException;

	public City getCity(String name) throws CoreException;

	/**
	 * 依条件查询城市
	 * 
	 * @param crit
	 * @return
	 * @throws CoreException
	 */
	public List<City> getCityList(CommonCriteria crit) throws CoreException;

	public District getDistrict(String name) throws CoreException;

	/**
	 * 依条件查询地区
	 * 
	 * @param crit
	 * @return
	 * @throws CoreException
	 */
	public List<District> getDistrictList(CommonCriteria crit) throws CoreException;

	/**
	 * 傳回COD手續費
	 * 
	 * @return
	 */
	public BigDecimal getCodFee();

	public BigDecimal getDaphneFee();

	boolean isCod(String city, String district);

	public void saveCity(City city) throws CoreException;

	public void saveDistrict(District district) throws CoreException;

	void setCodData() throws CoreException;

	void setFreight() throws CoreException;

	void setProvinceData() throws CoreException, Exception;

	public void updateCity(City city) throws CoreException, Exception;

	public void updateDistrict(District district) throws CoreException;

	public void generateAddressV2() throws CoreException, Exception;

	public HashMap getFreightMap();

	/**
	 * 傳回運費
	 * 
	 * @param provinceName
	 * @param weight
	 * @param orderAmount
	 * @param discount
	 * @return
	 */
	BigDecimal getFreight(String provinceName, BigDecimal weight, BigDecimal orderAmount, BigDecimal discount);

	BigDecimal getFreight(String provinceName, BigDecimal weight, BigDecimal orderAmount);

	public AddrMapping convertAddr(String province, String city, String county, String memo);
}